package cn.tedu.micro.demo.device.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
@Slf4j
public class HelloController {
        //属性注入
        @Value("${spring.application.name}")
        private String applicationName;

        @Value("${server.port}")
        private String port;

        @GetMapping("/device/hello")
        public String sayHello(){
            log.info("当前项目应用名称:{}",applicationName);
            return "hello; I am from "+port;
        }
}
